home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
AIncludes
/
Processes.a
< prev
next >
Wrap
Text File
|
1996-05-01
|
9KB
|
326 lines
;
; File: Processes.a
;
; Contains: Process Manager Interfaces.
;
; Version: Technology: System 7.5
; Release: Universal Interfaces 3.0d3 on Copland DR1
;
; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
;
; Bugs?: If you find a problem with this file, send the file and version
; information (from above) and the problem description to:
;
; Internet: apple.bugs@applelink.apple.com
; AppleLink: APPLE.BUGS
;
;
IF &TYPE('__PROCESSES__') = 'UNDEFINED' THEN
__PROCESSES__ SET 1
IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
include 'Types.a'
ENDIF
IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
include 'Events.a'
ENDIF
IF &TYPE('__FILES__') = 'UNDEFINED' THEN
include 'Files.a'
ENDIF
IF FOR_SYSTEM8_PREEMPTIVE THEN
IF &TYPE('__KERNEL__') = 'UNDEFINED' THEN
include 'Kernel.a'
ENDIF
IF &TYPE('__FILEMANAGERTYPES__') = 'UNDEFINED' THEN
include 'FileManagerTypes.a'
ENDIF
ENDIF
; type for unique process identifier
ProcessSerialNumber RECORD 0
highLongOfPSN ds.l 1 ; offset: $0 (0)
lowLongOfPSN ds.l 1 ; offset: $4 (4)
sizeof EQU * ; size: $8 (8)
ENDR
; typedef struct ProcessSerialNumber * ProcessSerialNumberPtr
; Process identifier - Various reserved process serial numbers
kNoProcess EQU 0
kSystemProcess EQU 1
kCurrentProcess EQU 2
IF FOR_SYSTEM8_PREEMPTIVE THEN
; supported versions for GetApplicationInformation
kApplicationInformationVersion EQU 1
ApplicationInformation RECORD 0
primaryTaskID ds.l 1 ; offset: $0 (0)
applicationLauncher ds.l 1 ; offset: $4 (4)
applicationFile ds.l 1 ; offset: $8 (8)
sizeof EQU * ; size: $C (12)
ENDR
; typedef struct ApplicationInformation * ApplicationInformationPtr
;
; extern OSStatus GetApplicationInformation(KernelProcessID theProcessID, PBVersion version, ApplicationInformation *appInfo)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetApplicationInformation
ENDIF
; supported versions for LaunchInformation structure
kLaunchInformationVersion EQU 1
LaunchInformation RECORD 0
kernelProcessID ds.l 1 ; offset: $0 (0)
sizeof EQU * ; size: $4 (4)
ENDR
; typedef struct LaunchInformation * LaunchInformationPtr
; for now, the launch call only supports an application in the FSObjectSpecification
;
; extern OSStatus Launch(FSObjectRef theFSObjectRef, PBVersion version, LaunchInformation *launchInfo)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION Launch
ENDIF
;
; extern OSStatus GetKernelProcessIDFromPSN(const ProcessSerialNumber *PSN, KernelProcessID *kernelProcessID)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetKernelProcessIDFromPSN
ENDIF
;
; extern OSStatus GetPSNFromKernelProcessID(KernelProcessID kernelProcessID, ProcessSerialNumber *PSN)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetPSNFromKernelProcessID
ENDIF
ENDIF
; Definition of the parameter block passed to _Launch
;
; Typedef and flags for launchControlFlags field
; #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED??
;
; typedef unsigned short LaunchFlags
launchContinue EQU $4000
launchNoFileFlags EQU $0800
launchUseMinimum EQU $0400
launchDontSwitch EQU $0200
launchAllow24Bit EQU $0100
launchInhibitDaemon EQU $0080
;
; Format for first AppleEvent to pass to new process. The size of the overall
; buffer variable: the message body immediately follows the messageLength
;
AppParameters RECORD 0
theMsgEvent ds EventRecord ; offset: $0 (0)
eventRefCon ds.l 1 ; offset: $10 (16)
messageLength ds.l 1 ; offset: $14 (20)
sizeof EQU * ; size: $18 (24)
ENDR
; typedef struct AppParameters * AppParametersPtr
; Parameter block to _Launch
LaunchParamBlockRec RECORD 0
reserved1 ds.l 1 ; offset: $0 (0)
reserved2 ds.w 1 ; offset: $4 (4)
launchBlockID ds.w 1 ; offset: $6 (6)
launchEPBLength ds.l 1 ; offset: $8 (8)
launchFileFlags ds.w 1 ; offset: $C (12)
launchControlFlags ds.w 1 ; offset: $E (14)
launchAppSpec ds.l 1 ; offset: $10 (16)
launchProcessSN ds ProcessSerialNumber ; offset: $14 (20)
launchPreferredSize ds.l 1 ; offset: $1C (28)
launchMinimumSize ds.l 1 ; offset: $20 (32)
launchAvailableSize ds.l 1 ; offset: $24 (36)
launchAppParameters ds.l 1 ; offset: $28 (40)
sizeof EQU * ; size: $2C (44)
ENDR
; typedef struct LaunchParamBlockRec * LaunchPBPtr
;
; Set launchBlockID to extendedBlock to specify that extensions exist.
; Set launchEPBLength to extendedBlockLen for compatibility.
;
extendedBlock EQU $4C43 ; 'LC'
extendedBlockLen EQU 32
; Definition of the information block returned by GetProcessInformation
modeLaunchDontSwitch EQU $00040000
modeDeskAccessory EQU $00020000
modeMultiLaunch EQU $00010000
modeNeedSuspendResume EQU $00004000
modeCanBackground EQU $00001000
modeDoesActivateOnFGSwitch EQU $00000800
modeOnlyBackground EQU $00000400
modeGetFrontClicks EQU $00000200
modeGetAppDiedMsg EQU $00000100
mode32BitCompatible EQU $00000080
modeHighLevelEventAware EQU $00000040
modeLocalAndRemoteHLEvents EQU $00000020
modeStationeryAware EQU $00000010
modeUseTextEditServices EQU $00000008
modeDisplayManagerAware EQU $00000004
; Record returned by GetProcessInformation
ProcessInfoRec RECORD 0
processInfoLength ds.l 1 ; offset: $0 (0)
processName ds.l 1 ; offset: $4 (4)
processNumber ds ProcessSerialNumber ; offset: $8 (8)
processType ds.l 1 ; offset: $10 (16)
processSignature ds.l 1 ; offset: $14 (20)
processMode ds.l 1 ; offset: $18 (24)
processLocation ds.l 1 ; offset: $1C (28)
processSize ds.l 1 ; offset: $20 (32)
processFreeMem ds.l 1 ; offset: $24 (36)
processLauncher ds ProcessSerialNumber ; offset: $28 (40)
processLaunchDate ds.l 1 ; offset: $30 (48)
processActiveTime ds.l 1 ; offset: $34 (52)
processAppSpec ds.l 1 ; offset: $38 (56)
sizeof EQU * ; size: $3C (60)
ENDR
; typedef struct ProcessInfoRec * ProcessInfoRecPtr
; #endif // FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED??
IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
;
; pascal OSErr LaunchApplication(LaunchPBPtr LaunchParams)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; LaunchParams => A0
; returns:
; OSErr <= D0
_LaunchApplication: OPWORD $A9F2
ELSE
IMPORT_CFM_FUNCTION LaunchApplication
ENDIF
;
; pascal OSErr LaunchDeskAccessory(const FSSpec *pFileSpec, ConstStr255Param pDAName)
;
IF ¨ GENERATINGCFM THEN
Macro
_LaunchDeskAccessory
move.w #$0036,-(sp)
dc.w $A88F
EndM
ELSE
IMPORT_CFM_FUNCTION LaunchDeskAccessory
ENDIF
;
; pascal OSErr GetCurrentProcess(ProcessSerialNumber *PSN)
;
IF ¨ GENERATINGCFM THEN
Macro
_GetCurrentProcess
move.w #$0037,-(sp)
dc.w $A88F
EndM
ELSE
IMPORT_CFM_FUNCTION GetCurrentProcess
ENDIF
;
; pascal OSErr GetFrontProcess(ProcessSerialNumber *PSN)
;
IF ¨ GENERATINGCFM THEN
Macro
_GetFrontProcess
moveq #-1,D0
move.l D0,-(sp)
move.w #$0039,-(sp)
dc.w $A88F
EndM
ELSE
IMPORT_CFM_FUNCTION GetFrontProcess
ENDIF
;
; pascal OSErr GetNextProcess(ProcessSerialNumber *PSN)
;
IF ¨ GENERATINGCFM THEN
Macro
_GetNextProcess
move.w #$0038,-(sp)
dc.w $A88F
EndM
ELSE
IMPORT_CFM_FUNCTION GetNextProcess
ENDIF
;
; pascal OSErr GetProcessInformation(const ProcessSerialNumber *PSN, ProcessInfoRec *info)
;
IF ¨ GENERATINGCFM THEN
Macro
_GetProcessInformation
move.w #$003A,-(sp)
dc.w $A88F
EndM
ELSE
IMPORT_CFM_FUNCTION GetProcessInformation
ENDIF
;
; pascal OSErr SetFrontProcess(const ProcessSerialNumber *PSN)
;
IF ¨ GENERATINGCFM THEN
Macro
_SetFrontProcess
move.w #$003B,-(sp)
dc.w $A88F
EndM
ELSE
IMPORT_CFM_FUNCTION SetFrontProcess
ENDIF
;
; pascal OSErr WakeUpProcess(const ProcessSerialNumber *PSN)
;
IF ¨ GENERATINGCFM THEN
Macro
_WakeUpProcess
move.w #$003C,-(sp)
dc.w $A88F
EndM
ELSE
IMPORT_CFM_FUNCTION WakeUpProcess
ENDIF
;
; pascal OSErr SameProcess(const ProcessSerialNumber *PSN1, const ProcessSerialNumber *PSN2, Boolean *result)
;
IF ¨ GENERATINGCFM THEN
Macro
_SameProcess
move.w #$003D,-(sp)
dc.w $A88F
EndM
ELSE
IMPORT_CFM_FUNCTION SameProcess
ENDIF
ENDIF
IF FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE THEN
IF ¨ OLDROUTINELOCATIONS THEN
;
; pascal void ExitToShell(void )
;
IF ¨ GENERATINGCFM THEN
_ExitToShell: OPWORD $A9F4
ELSE
IMPORT_CFM_FUNCTION ExitToShell
ENDIF
ENDIF
ENDIF
ENDIF ; __PROCESSES__